package com.shiva.oms.logview.domain;

import com.sf.shiva.oms.common.util.UUIDGenerator;

/**
 * 
 * 描述：日志模板配置实体
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID    DATE            PERSON            REASON
 *  1     2018年5月2日         YC           Create
 * ****************************************************************************
 * </pre>
 * 
 * @author YC
 * @version 1.0
 */
public class LogParseCfg extends CustomTemp2Local {

    private String cfgName;// 配置名
    private String type;// 日志类型
    private String pattern;// 日志内容格式
    private String dateFormat;// 日期时间格式
    // private String logName;// 日志文件名
    private String charset;// 日志编码格式

    public LogParseCfg() {
        this.id = UUIDGenerator.generate();
    }

    public LogParseCfg(String cfgName, String type, String pattern, String dateFormat, String charset) {
        this.id = UUIDGenerator.generate();
        this.cfgName = cfgName;
        this.type = type;
        this.pattern = pattern;
        this.dateFormat = dateFormat;
        this.charset = charset;
    }

    public String getCfgName() {
        return cfgName;
    }

    public void setCfgName(String cfgName) {
        this.cfgName = cfgName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getPattern() {
        return pattern;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public String getDateFormat() {
        return dateFormat;
    }

    public void setDateFormat(String dateFormat) {
        this.dateFormat = dateFormat;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null || this.getClass() != obj.getClass())
            return false;
        return this.getId().equals(((LogParseCfg) obj).getId());
    }

    @Override
    public String toString(){
        return this.id + "," + this.cfgName + "," + this.type + "," + this.pattern + ","
                + this.dateFormat + "," + this.charset;
    }

}
